const rule = {
  menuName: [{ required: true, message: '菜单名称不能为空', trigger: 'blur' }],
  orderNum: [{ required: true, message: '显示排序不能为空', trigger: 'blur' }],
  path: [{ required: true, message: '路由地址不能为空', trigger: 'blur' }],
}
const formItem = [
  {
    name: 'parentId',
    label: '上级菜单',
    type: 'a-tree-select',
    data: [],
    span: 24,
    fieldNames: {
      key: 'menuId',
      title: 'menuName',
      children: 'children',
    },
  },
  { name: 'menuType', label: '菜单类型', type: 'a-radio', options: [], span: 24 },
  { name: 'customIcon', label: '菜单图标', type: 'a-input', span: 24, hide: false },
  { name: 'menuName', label: '菜单名称', type: 'a-input' },
  { name: 'orderNum', label: '显示排序', type: 'a-input-number' },
  {
    name: 'isFrame',
    label: '是否外链',
    type: 'a-radio',
    options: [
      { label: '是', value: '0' },
      { label: '否', value: '1' },
    ],
    hide: false,
  },
  { name: 'path', label: '路由地址', type: 'a-input', hide: false },
  { name: 'component', label: '组件路径', type: 'a-input', hide: true },
  { name: 'perms', label: '权限标识', type: 'a-input', hide: true },
  {
    name: 'visible',
    label: '显示状态',
    type: 'a-radio',
    options: [
      { label: '显示', value: '0' },
      { label: '隐藏', value: '1' },
    ],
    hide: false,
  },
  { name: 'status', label: '菜单状态', type: 'a-radio', options: [], hide: false },
  {
    name: 'isCache',
    label: '是否缓存',
    type: 'a-radio',
    options: [
      { label: '缓存', value: '0' },
      { label: '不缓存', value: '1' },
    ],
    hide: true,
  },
]
const initFormData = {
  parentId: '',
  menuType: 'M',
  customIcon: '',
  menuName: '',
  orderNum: null,
  isFrame: '1',
  path: '',
  visible: '1',
  status: '0',
  isCache: '1',
  component: '',
  perms: '',
}
export { rule, initFormData, formItem }
